package thread.thread_pool;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Test1 {
    public static void main(String[] args) {
        // 核心线程为0，最大线程为int的最大取值
        ExecutorService executorService = Executors.newCachedThreadPool();
        for (int i = 0; i < 10; i++) {
            int finalI = i;
            executorService.submit(()-> System.out.println(Thread.currentThread().getName() + "--" + finalI));
        }
        executorService.shutdown();
    }
}
